<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.tftp.TFTPClient类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1tftp_1_1TFTPClient.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1tftp_1_1TFTPClient-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.tftp.TFTPClient类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>TFTPClient类封装了通过 TFTP 接收和发送文件所需的所有 TFTP 协议方面的细节。  
 <a href="classcommonsNet_1_1tftp_1_1TFTPClient.html#details">更多...</a></p>
<div class="dynheader">
类 commonsNet.tftp.TFTPClient 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1tftp_1_1TFTPClient.png" usemap="#commonsNet.tftp.TFTPClient_map" alt=""/>
  <map id="commonsNet.tftp.TFTPClient_map" name="commonsNet.tftp.TFTPClient_map">
<area href="classcommonsNet_1_1tftp_1_1TFTP.html" title="TFTP 类提供了直接与 TFTP（Trivial File Transfer Protocol）协议交互的方法。它扩展了 DatagramSocketClient 。" alt="commonsNet.tftp.TFTP" shape="rect" coords="0,56,211,80"/>
<area href="classcommonsNet_1_1DatagramSocketClient.html" alt="commonsNet.DatagramSocketClient" shape="rect" coords="0,0,211,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a142a7abcabd59e315c12d8308e897f83"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a142a7abcabd59e315c12d8308e897f83">getMaxTimeouts</a> (): Int64</td></tr>
<tr class="memdesc:a142a7abcabd59e315c12d8308e897f83"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建一个 TFTPClient 实例，具有 DEFAULT_TIMEOUT 的默认超时值，DEFAULT_MAX_TIMEOUTS 的最大超时值。  <br /></td></tr>
<tr class="separator:a142a7abcabd59e315c12d8308e897f83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a122ccb35675551fdf80ba43852f2baa1"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a122ccb35675551fdf80ba43852f2baa1">getTotalBytesReceived</a> (): Int64</td></tr>
<tr class="separator:a122ccb35675551fdf80ba43852f2baa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f72c0ca829d3d5f8acb8549441cc6d8"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a6f72c0ca829d3d5f8acb8549441cc6d8">getTotalBytesSent</a> (): Int64</td></tr>
<tr class="separator:a6f72c0ca829d3d5f8acb8549441cc6d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada1f5c5fd6777ed163d178f471d219ac"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#ada1f5c5fd6777ed163d178f471d219ac">receiveFile</a> (fileName: String, mode: Int64, output: OutputStream, host: String): Int64</td></tr>
<tr class="memdesc:ada1f5c5fd6777ed163d178f471d219ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">与调用 receiveFile(fileName, mode, output, host, TFTP.DEFAULT_PORT) 相同。  <br /></td></tr>
<tr class="separator:ada1f5c5fd6777ed163d178f471d219ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3fd6dd9d94c00d266ad8abc5fcb445c"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#af3fd6dd9d94c00d266ad8abc5fcb445c">receiveFile</a> (fileName: String, mode: Int64, output: OutputStream, host: String, port: UInt16): Int64</td></tr>
<tr class="memdesc:af3fd6dd9d94c00d266ad8abc5fcb445c"><td class="mdescLeft">&#160;</td><td class="mdescRight">请求从远程主机获取指定的文件，将文件写入 OutputStream ，关闭连接，并返回读取的字节数。  <br /></td></tr>
<tr class="separator:af3fd6dd9d94c00d266ad8abc5fcb445c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b48f55a5ed2291fd3932475b820e277"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a3b48f55a5ed2291fd3932475b820e277">sendFile</a> (fileName: String, mode: Int64, input: InputStream, host: String): Unit</td></tr>
<tr class="memdesc:a3b48f55a5ed2291fd3932475b820e277"><td class="mdescLeft">&#160;</td><td class="mdescRight">与调用 sendFile(fileName, mode, input, host, port) 相同。  <br /></td></tr>
<tr class="separator:a3b48f55a5ed2291fd3932475b820e277"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05d4c3b4ab209f11d4ce5747e8355b35"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a05d4c3b4ab209f11d4ce5747e8355b35">sendFile</a> (fileName: String, mode: Int64, input: InputStream, host: String, port: UInt16)</td></tr>
<tr class="memdesc:a05d4c3b4ab209f11d4ce5747e8355b35"><td class="mdescLeft">&#160;</td><td class="mdescRight">请求发送文件到远程主机，从 InputStream 读取文件，将文件发送到远程主机，并关闭连接。  <br /></td></tr>
<tr class="separator:a05d4c3b4ab209f11d4ce5747e8355b35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a683297bb2d6362451ac3d3de9a505a5f"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a683297bb2d6362451ac3d3de9a505a5f">setMaxTimeouts</a> (numTimeouts: Int64): Unit</td></tr>
<tr class="memdesc:a683297bb2d6362451ac3d3de9a505a5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置允许超时尝试的最大次数。这是指在 receive() 方法等待数据包时允许的超时次数。  <br /></td></tr>
<tr class="separator:a683297bb2d6362451ac3d3de9a505a5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcommonsNet_1_1tftp_1_1TFTP')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html">commonsNet.tftp.TFTP</a></td></tr>
<tr class="memitem:a1e7a8e190ca83645d39bdda63472f430 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a1e7a8e190ca83645d39bdda63472f430">getModeName</a> (mode: Int64): String</td></tr>
<tr class="memdesc:a1e7a8e190ca83645d39bdda63472f430 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">返回指定 TFTP 传输模式的字符串表示形式。  <br /></td></tr>
<tr class="separator:a1e7a8e190ca83645d39bdda63472f430 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3e18e13fd8872bb500c811064cca7b1 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#ab3e18e13fd8872bb500c811064cca7b1">discardPackets</a> (): Unit</td></tr>
<tr class="memdesc:ab3e18e13fd8872bb500c811064cca7b1 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造一个默认的 TFTP 实例。  <br /></td></tr>
<tr class="separator:ab3e18e13fd8872bb500c811064cca7b1 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc28f1ef8cee16f3a4e5a89cc0202a8b inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#adc28f1ef8cee16f3a4e5a89cc0202a8b">receive</a> ()</td></tr>
<tr class="memdesc:adc28f1ef8cee16f3a4e5a89cc0202a8b inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收一个 TFTPPacket 数据包。  <br /></td></tr>
<tr class="separator:adc28f1ef8cee16f3a4e5a89cc0202a8b inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07b7a316dfe3780654e911b9328a2650 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a07b7a316dfe3780654e911b9328a2650">send</a> (packet: <a class="el" href="classcommonsNet_1_1tftp_1_1TFTPPacket.html">TFTPPacket</a>): Unit</td></tr>
<tr class="memdesc:a07b7a316dfe3780654e911b9328a2650 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">向目标发送一个 TFTP 数据包。  <br /></td></tr>
<tr class="separator:a07b7a316dfe3780654e911b9328a2650 inherit pub_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a9bebd92e7988ee9c12dbcf538f236868">init</a> ()</td></tr>
<tr class="memdesc:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">无参构造函数 <em>socket</em>=None; <em>timeout</em>=0; <em>isOpen</em>=false; <em>socketFactory</em>= DEFAULT_SOCKET_FACTORY;  <br /></td></tr>
<tr class="separator:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a0a94deac969cd5a4cea9634d9195d658">receiveTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性readTimeout，用于设置和获取readTimeout  <br /></td></tr>
<tr class="separator:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac91a43c12fc616a881e49a3764364f2d">sendTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性sendTimeout，用于设置和获取sendTimeout  <br /></td></tr>
<tr class="separator:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a95f9d80f21489bb3eb1c251d30b8aeaf">close</a> ()</td></tr>
<tr class="memdesc:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于关闭套接字  <br /></td></tr>
<tr class="separator:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a8568072f87aa0cc170d01eeea0d4274b">getDefaultTimeout</a> (): Int64</td></tr>
<tr class="memdesc:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取打开套接字时使用的默认超时（以毫秒为单位）  <br /></td></tr>
<tr class="separator:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aafdf43214202f97695ffe50f8e77c3f6">getLocalAddress</a> (): Array&lt;UInt8&gt;</td></tr>
<tr class="memdesc:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取客户端的套接字绑定到的本地地址。  <br /></td></tr>
<tr class="separator:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aec74781fb202de91341c1151836dce88">getLocalPort</a> (): UInt16</td></tr>
<tr class="memdesc:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取本地主机上打开的用于连接的套接字的端口号。  <br /></td></tr>
<tr class="separator:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a537cb7e36f353ef171bc5477cf12d14c">isOpen</a> (): Bool</td></tr>
<tr class="memdesc:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果客户端具有当前打开的套接字，则为 true。  <br /></td></tr>
<tr class="separator:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac49b33247f17bf47dd062d1e68d7cb24">open</a> ()</td></tr>
<tr class="memdesc:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的第一个可用端口处打开 DatagramSocket。  <br /></td></tr>
<tr class="separator:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#acfe0264b2b558712ef0605bbe6e6d805">open</a> (port: UInt16)</td></tr>
<tr class="memdesc:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的指定端口处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#afc3da28ec94b12365a60e0a8e0273409">open</a> (IPSocketAddress: IPSocketAddress)</td></tr>
<tr class="memdesc:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在指定端口的本地主机上的指定地址处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a07f62c0c51a3d53142f08bc13d447ca0">setDatagramSocketFactory</a> (factory: ?<a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a>)</td></tr>
<tr class="memdesc:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置DatagramSocketClient使用的DatagramSocketFactory来打开DatagramSockets  <br /></td></tr>
<tr class="separator:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a2986e7ad450928ce89e35b38ec539fd8">setDefaultTimeout</a> (timeout: Duration)</td></tr>
<tr class="memdesc:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aa7c800ada59a901f353dab58758525d6">setDefaultTimeout</a> (timeout: Int64)</td></tr>
<tr class="memdesc:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a58a76942caae630b93bf9800d4f4d34e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#a58a76942caae630b93bf9800d4f4d34e">static let DEFAULT_MAX_TIMEOUTS</a> : Int64 = 5;</td></tr>
<tr class="memdesc:a58a76942caae630b93bf9800d4f4d34e"><td class="mdescLeft">&#160;</td><td class="mdescRight">在放弃重试 receive 并失败之前，允许的 receive 尝试超时的默认最大次数。默认为5次超时。  <br /></td></tr>
<tr class="separator:a58a76942caae630b93bf9800d4f4d34e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classcommonsNet_1_1tftp_1_1TFTP')"><img src="closed.png" alt="-"/>&#160;Public 属性 继承自 <a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html">commonsNet.tftp.TFTP</a></td></tr>
<tr class="memitem:a51a7b711a2ecfcbbcf7733c33db1cfb7 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a51a7b711a2ecfcbbcf7733c33db1cfb7">static let ASCII_MODE</a> = 0;</td></tr>
<tr class="memdesc:a51a7b711a2ecfcbbcf7733c33db1cfb7 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">ASCII 传输模式，等同于 NETASCII_MODE 。  <br /></td></tr>
<tr class="separator:a51a7b711a2ecfcbbcf7733c33db1cfb7 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa82de7e19bd19d8df8b1aea877af6e12 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#aa82de7e19bd19d8df8b1aea877af6e12">static let NETASCII_MODE</a> = 0;</td></tr>
<tr class="memdesc:aa82de7e19bd19d8df8b1aea877af6e12 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">NETASCII 传输模式，等同于 ASCII_MODE 。  <br /></td></tr>
<tr class="separator:aa82de7e19bd19d8df8b1aea877af6e12 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fa66e40cb09806732c0ae06c3b04cb8 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a6fa66e40cb09806732c0ae06c3b04cb8">static let BINARY_MODE</a> = 1;</td></tr>
<tr class="memdesc:a6fa66e40cb09806732c0ae06c3b04cb8 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">二进制传输模式，等同于 OCTET_MODE 。  <br /></td></tr>
<tr class="separator:a6fa66e40cb09806732c0ae06c3b04cb8 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abeb42d6b3fa36ae9c1ae63bcb1f551e0 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#abeb42d6b3fa36ae9c1ae63bcb1f551e0">static let IMAGE_MODE</a> = 1;</td></tr>
<tr class="memdesc:abeb42d6b3fa36ae9c1ae63bcb1f551e0 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">图像传输模式，等同于 OCTET_MODE 。  <br /></td></tr>
<tr class="separator:abeb42d6b3fa36ae9c1ae63bcb1f551e0 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4887ed74c5af65cf64fd2d59d85a45c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#ac4887ed74c5af65cf64fd2d59d85a45c">static let OCTET_MODE</a> = 1;</td></tr>
<tr class="memdesc:ac4887ed74c5af65cf64fd2d59d85a45c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">八位字节传输模式。  <br /></td></tr>
<tr class="separator:ac4887ed74c5af65cf64fd2d59d85a45c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afea9151590a6bb6db9ff97b81c22ae3c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#afea9151590a6bb6db9ff97b81c22ae3c">static let DEFAULT_TIMEOUT_DURATION</a> : Duration = Duration.second * 5</td></tr>
<tr class="memdesc:afea9151590a6bb6db9ff97b81c22ae3c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认超时时间，为5秒。  <br /></td></tr>
<tr class="separator:afea9151590a6bb6db9ff97b81c22ae3c inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78d002dc551c09381b865afb699c4728 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a78d002dc551c09381b865afb699c4728">static let DEFAULT_PORT</a> : UInt16 = 69;</td></tr>
<tr class="memdesc:a78d002dc551c09381b865afb699c4728 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">TFTP 的默认端口号，根据 RFC 783 定义为 69。  <br /></td></tr>
<tr class="separator:a78d002dc551c09381b865afb699c4728 inherit pub_attribs_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:ae228ca62799bfc542ab4519383ee0d87"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#ae228ca62799bfc542ab4519383ee0d87">var maxTimeouts</a> : Int64</td></tr>
<tr class="memdesc:ae228ca62799bfc542ab4519383ee0d87"><td class="mdescLeft">&#160;</td><td class="mdescRight">允许失败之前的最大超时次数。  <br /></td></tr>
<tr class="separator:ae228ca62799bfc542ab4519383ee0d87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaea91c09649a6089418b5dc27dc5617e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#aaea91c09649a6089418b5dc27dc5617e">var totalBytesReceived</a> : Int64</td></tr>
<tr class="memdesc:aaea91c09649a6089418b5dc27dc5617e"><td class="mdescLeft">&#160;</td><td class="mdescRight">下载中接收的字节数。  <br /></td></tr>
<tr class="separator:aaea91c09649a6089418b5dc27dc5617e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2d4d95167ce0a205f288070330d83c5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html#aa2d4d95167ce0a205f288070330d83c5">var totalBytesSent</a> : Int64</td></tr>
<tr class="memdesc:aa2d4d95167ce0a205f288070330d83c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">上传中发送的字节数。  <br /></td></tr>
<tr class="separator:aa2d4d95167ce0a205f288070330d83c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_methods_classcommonsNet_1_1tftp_1_1TFTP"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcommonsNet_1_1tftp_1_1TFTP')"><img src="closed.png" alt="-"/>&#160;Protected 成员函数 继承自 <a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html">commonsNet.tftp.TFTP</a></td></tr>
<tr class="memitem:a53c5dcba4632dc694a14d519ab3b2bd8 inherit pro_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memItemLeft" align="right" valign="top">protected func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTP.html#a53c5dcba4632dc694a14d519ab3b2bd8">trace</a> (direction: String, packet: <a class="el" href="classcommonsNet_1_1tftp_1_1TFTPPacket.html">TFTPPacket</a>): Unit</td></tr>
<tr class="memdesc:a53c5dcba4632dc694a14d519ab3b2bd8 inherit pro_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="mdescLeft">&#160;</td><td class="mdescRight">跟踪功能，此实现不执行任何操作。  <br /></td></tr>
<tr class="separator:a53c5dcba4632dc694a14d519ab3b2bd8 inherit pro_methods_classcommonsNet_1_1tftp_1_1TFTP"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Protected 成员函数 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">protected func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a7060e4aa1d53b57b837bfc280eaa9daf">checkOpen</a> (): UdpSocket</td></tr>
<tr class="memdesc:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">得到非空的UdpSocket或者抛出异常  <br /></td></tr>
<tr class="separator:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac1d6e58d6682ffe35a5d1ddd767f747b">var _timeout_</a> : Int64</td></tr>
<tr class="memdesc:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认超时  <br /></td></tr>
<tr class="separator:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ae817188cccd266d039b791da4f839c4d">var _socket_</a> : ?UdpSocket</td></tr>
<tr class="memdesc:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于连接的数据报套接字  <br /></td></tr>
<tr class="separator:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a81cba3257050238fc73f20aadceb4d69">var _isOpen_</a> : Bool</td></tr>
<tr class="memdesc:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端的套接字当前是否处于打开状态  <br /></td></tr>
<tr class="separator:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aae67ef3bfdd385af99f91c034e941bcc">var _socketFactory_</a> : <a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a></td></tr>
<tr class="memdesc:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">数据报套接字的 DatagramSocketFactory  <br /></td></tr>
<tr class="separator:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>TFTPClient类封装了通过 TFTP 接收和发送文件所需的所有 TFTP 协议方面的细节。 </p>
<p>大多数用户只需关注 <code><a class="el" href="">open()</a></code>、<code><a class="el" href="">close()</a></code> 方法 <code><a class="el" href="">sendFile()</a></code> 和 <code><a class="el" href="">receiveFile()</a></code>方法以及可能的<code><a class="el" href="">setMaxTimeouts()</a></code> 、setDefaultTimeout() 进行性能调优。 TFTP 协议和数据包格式的详细信息可在 RFC 783 中找到。</p>
<dl class="section see"><dt>参见</dt><dd>TFTP </dd>
<dd>
TFTPPacket </dd>
<dd>
TFTPPacketException </dd></dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a142a7abcabd59e315c12d8308e897f83" name="a142a7abcabd59e315c12d8308e897f83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a142a7abcabd59e315c12d8308e897f83">&#9670;&#160;</a></span>getMaxTimeouts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.getMaxTimeouts </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建一个 TFTPClient 实例，具有 DEFAULT_TIMEOUT 的默认超时值，DEFAULT_MAX_TIMEOUTS 的最大超时值。 </p>
<p>返回允许在接收文件或发送文件操作中超时之前尝试接收的最大次数。</p>
<dl class="section return"><dt>返回</dt><dd>允许的最大超时次数。 </dd></dl>

</div>
</div>
<a id="a122ccb35675551fdf80ba43852f2baa1" name="a122ccb35675551fdf80ba43852f2baa1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a122ccb35675551fdf80ba43852f2baa1">&#9670;&#160;</a></span>getTotalBytesReceived()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.getTotalBytesReceived </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>正在进行的下载中接收的总字节数 </dd></dl>

</div>
</div>
<a id="a6f72c0ca829d3d5f8acb8549441cc6d8" name="a6f72c0ca829d3d5f8acb8549441cc6d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f72c0ca829d3d5f8acb8549441cc6d8">&#9670;&#160;</a></span>getTotalBytesSent()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.getTotalBytesSent </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>正在进行的上传中发送的总字节数 </dd></dl>

</div>
</div>
<a id="ada1f5c5fd6777ed163d178f471d219ac" name="ada1f5c5fd6777ed163d178f471d219ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ada1f5c5fd6777ed163d178f471d219ac">&#9670;&#160;</a></span>receiveFile() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.receiveFile </td>
          <td>(</td>
          <td class="paramname"><em>fileName</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>mode</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>output</em>:&#160;</td>
          <td class="paramtype">OutputStream, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>与调用 receiveFile(fileName, mode, output, host, TFTP.DEFAULT_PORT) 相同。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>要接收的文件的名称。 </td></tr>
    <tr><td class="paramname">mode</td><td>传输的TFTP模式（MODE常量之一） </td></tr>
    <tr><td class="paramname">output</td><td>应写入文件的OutputStream </td></tr>
    <tr><td class="paramname">host</td><td>提供文件的远程主机。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>读取的字节数 </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">IOException</td><td>如果发生I/O错误。错误的性质将在消息中报告。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af3fd6dd9d94c00d266ad8abc5fcb445c" name="af3fd6dd9d94c00d266ad8abc5fcb445c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3fd6dd9d94c00d266ad8abc5fcb445c">&#9670;&#160;</a></span>receiveFile() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.receiveFile </td>
          <td>(</td>
          <td class="paramname"><em>fileName</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>mode</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>output</em>:&#160;</td>
          <td class="paramtype">OutputStream, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>port</em>:&#160;</td>
          <td class="paramtype">UInt16&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>请求从远程主机获取指定的文件，将文件写入 OutputStream ，关闭连接，并返回读取的字节数。 </p>
<p>必须先使用 open() 方法创建本地 DatagramSocket ,然后调用此方法。 此方法不会关闭包含文件的 OutputStream ，您必须在方法调用后关闭它。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>要接收的文件名 </td></tr>
    <tr><td class="paramname">mode</td><td>传输的TFTP模式（MODE常量之一） </td></tr>
    <tr><td class="paramname">output</td><td>应写入文件的 OutputStream </td></tr>
    <tr><td class="paramname">hostname</td><td>提供文件的远程主机名 </td></tr>
    <tr><td class="paramname">port</td><td>远程 TFTP 服务器的端口号 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>读取的字节数 </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">IOException</td><td>如果发生I/O错误。错误的性质将在消息中报告 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3b48f55a5ed2291fd3932475b820e277" name="a3b48f55a5ed2291fd3932475b820e277"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b48f55a5ed2291fd3932475b820e277">&#9670;&#160;</a></span>sendFile() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.sendFile </td>
          <td>(</td>
          <td class="paramname"><em>fileName</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>mode</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>input</em>:&#160;</td>
          <td class="paramtype">InputStream, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>与调用 sendFile(fileName, mode, input, host, port) 相同。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>远程服务器在其文件系统上创建文件时应使用的名称 </td></tr>
    <tr><td class="paramname">mode</td><td>传输的TFTP模式（MODE常量之一） </td></tr>
    <tr><td class="paramname">input</td><td>包含要发送的数据的输入流 </td></tr>
    <tr><td class="paramname">host</td><td>接收文件的远程主机名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">IOException</td><td>如果发生I/O错误。错误的性质将在消息中报告。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a05d4c3b4ab209f11d4ce5747e8355b35" name="a05d4c3b4ab209f11d4ce5747e8355b35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05d4c3b4ab209f11d4ce5747e8355b35">&#9670;&#160;</a></span>sendFile() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.sendFile </td>
          <td>(</td>
          <td class="paramname"><em>fileName</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>mode</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>input</em>:&#160;</td>
          <td class="paramtype">InputStream, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>port</em>:&#160;</td>
          <td class="paramtype">UInt16&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>请求发送文件到远程主机，从 InputStream 读取文件，将文件发送到远程主机，并关闭连接。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>远程服务器在其文件系统上创建文件时应使用的名称 </td></tr>
    <tr><td class="paramname">mode</td><td>传输的 TFTP 模式（MODE 常量之一） </td></tr>
    <tr><td class="paramname">input</td><td>包含要发送的数据的输入流 </td></tr>
    <tr><td class="paramname">hostname</td><td>接收文件的远程主机的名称。 </td></tr>
    <tr><td class="paramname">port</td><td>远程 TFTP 服务器的端口号。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">IOException</td><td>发生 I/O 错误 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a683297bb2d6362451ac3d3de9a505a5f" name="a683297bb2d6362451ac3d3de9a505a5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a683297bb2d6362451ac3d3de9a505a5f">&#9670;&#160;</a></span>setMaxTimeouts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.tftp.TFTPClient.setMaxTimeouts </td>
          <td>(</td>
          <td class="paramname"><em>numTimeouts</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置允许超时尝试的最大次数。这是指在 receive() 方法等待数据包时允许的超时次数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">numTimeouts</td><td>最大超时次数 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a58a76942caae630b93bf9800d4f4d34e" name="a58a76942caae630b93bf9800d4f4d34e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58a76942caae630b93bf9800d4f4d34e">&#9670;&#160;</a></span>static let DEFAULT_MAX_TIMEOUTS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.tftp.TFTPClient.static let DEFAULT_MAX_TIMEOUTS : Int64 = 5;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在放弃重试 receive 并失败之前，允许的 receive 尝试超时的默认最大次数。默认为5次超时。 </p>

</div>
</div>
<a id="ae228ca62799bfc542ab4519383ee0d87" name="ae228ca62799bfc542ab4519383ee0d87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae228ca62799bfc542ab4519383ee0d87">&#9670;&#160;</a></span>var maxTimeouts</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.tftp.TFTPClient.var maxTimeouts : Int64</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>允许失败之前的最大超时次数。 </p>

</div>
</div>
<a id="aaea91c09649a6089418b5dc27dc5617e" name="aaea91c09649a6089418b5dc27dc5617e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaea91c09649a6089418b5dc27dc5617e">&#9670;&#160;</a></span>var totalBytesReceived</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.tftp.TFTPClient.var totalBytesReceived : Int64</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>下载中接收的字节数。 </p>

</div>
</div>
<a id="aa2d4d95167ce0a205f288070330d83c5" name="aa2d4d95167ce0a205f288070330d83c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2d4d95167ce0a205f288070330d83c5">&#9670;&#160;</a></span>var totalBytesSent</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.tftp.TFTPClient.var totalBytesSent : Int64</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>上传中发送的字节数。 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/tftp/<a class="el" href="tftp__client_8cj.html">tftp_client.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="namespacecommonsNet_1_1tftp.html">tftp</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1tftp_1_1TFTPClient.html">TFTPClient</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
